package com.ujiuye.controller;


import com.ujiuye.config.MessageConstant;
import com.ujiuye.config.Result;
import com.ujiuye.service.IOrderService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 订单-会员下单预约检查 前端控制器
 * </p>
 *
 * @author zs
 * @since 2021-07-05
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Reference
    private IOrderService orderService;
    @PostMapping("submitOrder")
    public Result saveOrder(@RequestBody Map<String,Object> order){
        try {
           return orderService.saveOrder(order);
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false, MessageConstant.ORDER_FAIL);
        }

    }

}

